package com.bishe.demo.modules.other.dao;

import com.bishe.demo.modules.other.entity.SceneryUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface SceneryUserDao {
    @Insert("insert into other_scenery_user values(null,#{sceneryId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
    void insertSceneryUser(SceneryUser sceneryUser);

    @Delete("delete from other_scenery_user where scenery_id=#{sceneryId}")
    void deleteSceneryUserBySceneryId(int sceneryId);

    @Delete("delete from other_scenery_user where user_id=#{userId}")
    void deleteSceneryUserByUserId(int userId);
}
